package com.test.dao;

import com.test.pojo.User;
import org.apache.ibatis.annotations.*;

import java.util.List;
import java.util.Map;

public interface UserMapper {

    @Select("select * from user")
    List<Map<String,Object>> getUserList();

    @Select("select * from user where id = #{pid}")
    User getUserById(@Param(value="pid") Integer id);

    @Insert("insert into user (id,name,pwd) values (#{id},#{name},#{pwd}) ")
    void addUser(User user);

    @Delete("delete from user where id = #{id}")
    void delUser(Integer id);

    @Update("update user u set u.name=#{name},u.pwd=#{pwd} where id = #{id}")
    void upUser(User user);
}
